﻿<phone:PhoneApplicationPage xmlns:my="clr-namespace:MP3tunes.LockerPlayer.UserControls"  
    x:Class="MP3tunes.LockerPlayer.Pages.AlbumPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource BaseForeground}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot"  Background="{StaticResource DefaultBackground}">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="25"/>
        </Grid.RowDefinitions>
        <!--Pivot Control-->
        <controls:Pivot Grid.Row="0" Name="pivotControl">
            <controls:Pivot.Title>

                <StackPanel Orientation="Horizontal">
                    <Image Source="/MP3tunes.LockerPlayer;component/Images/MP3tunes2.png" Width="120" VerticalAlignment="Center" HorizontalAlignment="Center" ImageOpened="Image_ImageOpened"></Image>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="Locker Player" FontSize="45" Foreground="{StaticResource BaseForeground}" />
                        <TextBlock Text="Artist" FontSize="25" Name="artistLabel" Foreground="{StaticResource BaseForeground}"/>
                    </StackPanel>
                </StackPanel>


            </controls:Pivot.Title>


            <!--Pivot item two-->
            <controls:PivotItem Name="albums">
                <controls:PivotItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Albums" FontStyle="Italic" FontSize="40" VerticalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}"/>
                    </StackPanel>
                </controls:PivotItem.Header>
                <Grid>
                    <ListBox Margin="0,0,-12,0" ItemsSource="{Binding}" 
                              Style="{StaticResource LockerListStyle}"
                              ItemsPanel="{StaticResource LockerListItemsPanelTemplate}"
                             ItemContainerStyle="{StaticResource LockerListItemStyle}"
                             x:Name="listAlbums"  Grid.Row="0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,0,0,17" Width="430">
                                    <!--Replace rectangle with image-->
                                    <Image Height="150" Width="150" Margin="12,0,9,0" Source="{Binding Path=AlbumArtUrl}" Stretch="Uniform">
                                        <Image.Clip>
                                            <RectangleGeometry RadiusX="12" RadiusY="12" Rect="0,0,150,150" />
                                        </Image.Clip>
                                    </Image>

                                    <StackPanel Width="311">
                                        <TextBlock Text="{Binding AlbumTitle}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" Foreground="{StaticResource BaseForeground}"/>
                                        <TextBlock Text="{Binding ArtistName}" TextWrapping="Wrap"  Style="{StaticResource PhoneTextSubtleStyle}"  Foreground="{StaticResource BaseForegroundAccent}"  />
                                    </StackPanel>
                                </StackPanel>


                            </DataTemplate>

                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>

            <controls:PivotItem  Name="menu">
                <controls:PivotItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Menu" FontStyle="Italic" FontSize="40" VerticalAlignment="Center" Foreground="{StaticResource PhoneAccentBrush}"/>
                    </StackPanel>
                </controls:PivotItem.Header>
                <Grid>
                    <my:AppMenu OnNavigate="AppMenu_OnNavigate" />
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
        <Grid Grid.Row="1">
            <ProgressBar Style="{StaticResource PerformanceProgressBar}" Name="statusProgress" IsIndeterminate="True"/>
        </Grid>
    </Grid>

    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>